package com.jonah.demo.hbase.thrift;

import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.filter.FilterList;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface HbaseService {
//    /**
//     * 查询全表的数据
//     *
//     * @param tablename
//     * @return
//     */
//    public List<Result> scaner(String tablename);

    /**
     * 根据rowKey查询单条记录
     *
     * @param tableName
     * @param rowKey
     * @return
     */
    public Map<String, Object> getRow(String tableName, List<Map<String, String>> column, String rowKey) throws IOException;


    /**
     * 根据rowKey查询多条记录
     *
     * @param tableName
     * @param rowKey
     * @return
     */
    List<Map<String, Object>> getRows(String tableName, List<Map<String, String>> columns, List<Get> rowKey) throws IOException;

    int addData(String rowKey, String tableName, String family, String[] column, String[] value) throws IOException;

    <PARAM, RESULT> List<RESULT> getRows(String tableName, FilterList filterList, HBaseServiceAfter<PARAM, RESULT> after) throws Exception;

    <PARAM, RESULT> List<RESULT> getRows(String tableName, List<Get> filterList, HBaseServiceAfter<PARAM, RESULT> after) throws Exception;

    Boolean puts(String tableName, List<Put> puts) throws Exception;

    Boolean puts(String tableName, Put put) throws Exception;
}
